package agent;

import processing.core.PVector;

public class TestAgent extends Agent {

	TestAgent(Main p) {
		super(p);
		addPosition(new PVector(p.random(0,p.width),p.random(0,p.height)));
		addVelocity(new PVector(2, 0));
		colors = new int[]{p.color(255,127,127)};
		
		for (int i = 1; i < 10; i++) {
			// Add a history of positions
			addPosition(new PVector(getCurrentPosition().x, getCurrentPosition().y));
			addVelocity(new PVector(getCurrentVelocity().x, getCurrentVelocity().y));
		}
		
		//add fields to 
		
		//instantiate behaviors
		AvoidEdgesBehavior avoidEdges = new AvoidEdgesBehavior(p);
		TestBehavior mainBehavior = new TestBehavior(p, p.PI/16);
		LimitVelocityBehavior limitVelocity = new LimitVelocityBehavior(p, 3);
		FlockingBehavior flock = new FlockingBehavior(p, 500, 15);
		SquareBehavior square =  new SquareBehavior(p);
				
		//add behaviors to agent
		behaviors.add(mainBehavior);
		behaviors.add(flock);
		behaviors.add(avoidEdges);
		behaviors.add(limitVelocity);
		behaviors.add(square);

	}


}
